package com.beiing.tianshuai.tianshuai.presenter;

import com.beiing.tianshuai.tianshuai.base.BasePresenter;
import com.beiing.tianshuai.tianshuai.entity.SplashBean;
import com.beiing.tianshuai.tianshuai.model.SplashModel;
import com.beiing.tianshuai.tianshuai.model.SplashModelImpl;
import com.beiing.tianshuai.tianshuai.view.SplashViewImpl;

/**
 * Created by Jinni on 2017/8/9 0009.
 */

public class SplashPresenter extends BasePresenter implements SplashPresenterImpl, SplashModel.OnRequestListener {

    private SplashViewImpl      mView;
    private SplashModelImpl     mModel;

    public SplashPresenter(SplashViewImpl view) {
        mView = view;
        mModel = new SplashModel(this);
    }

    @Override
    public void getSplashInfo() {
        mView.showProgress();
        mModel.getSplashInfo();
    }

    @Override
    public void onSuccess(SplashBean bean) {
        mView.hideProgress();
        mView.onRequestSuccess(bean);
    }

    @Override
    public void onError(Throwable throwable) {
        mView.hideProgress();
        mView.onRequestFailed(throwable);
    }
}
